//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package study.方法引用;

import java.util.Arrays;
import java.util.Comparator;

public class MethodReferences {
    public MethodReferences() {
    }

    public static void main(String[] args) {
        Integer[] arr = new Integer[]{1, 4, 6, 3, 8, 9};
        Arrays.sort(arr, new Comparator<Integer>() {
            public int compare(Integer o1, Integer o2) {
                return o2 - o1;
            }
        });
        Arrays.sort(arr, (o1, o2) -> o2 - o1);
        Arrays.sort(arr, MethodReferences::subtraction);
        System.out.println(Arrays.toString(arr));
    }

    public static int subtraction(int n1, int n2) {
        return n2 - n1;
    }
}
